package com.zhou.day2;

import com.zhou.utils.IDCardValidate;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test {
    public static void main(String[] args) {
        String idCard = "";
//        String dn = "CN=张三 330101199003011234, OU=00, OU=00, O=11, L=01, L=01, ST=33, C=CN";
        String dn = "EMAILADDRESS=liyu@gaj.mzs.dys.sc, CN=李宇 362323199806154216, OU=00, OU=00, O=43, L=83, L=06, ST=51, C=CN";
        String reg = "\\d{17}[\\d|x]|\\d{15}";
        Pattern compile = Pattern.compile(reg);
        Matcher matcher = compile.matcher(dn);
        while (matcher.find()) {
            idCard = matcher.group();
        }
        System.out.println(idCard);
    }
}
